// 需要处理先将字符串进行转换
/**
 * @param {string} a
 * @param {string} b
 */
const addBig = (a, b) => {
  const maxLen = Math.max(a.length, b.length);
  let res = "";
  let next = 0;
  a = a.split("").reverse().join("");
  b = b.split("").reverse().join("");
  for (let i = 0; i < maxLen; i++) {
    let num1 = a[i] == undefined ? 0 : parseInt(a[i]);
    let num2 = b[i] == undefined ? 0 : parseInt(b[i]);
    let addRes = num1 + num2 + next;
    next = Math.floor(addRes / 10);
    res = (addRes % 10) + res;
  }
  if (next != 0) {
    res = next + res;
  }
  return res;
};

const addBigEdition = (a, b) => {
  const arr1 = a.split(".");
  const arr2 = b.split(".");
  const decimalMaxLen = Math.max(arr1[1].length, arr2[1].length);
  while (arr1[1].length < decimalMaxLen) {
    arr1[1] = arr1[1] + "0";
  }
  while (arr2[1].length < decimalMaxLen) {
    arr2[1] = arr2[1] + "0";
  }
  let decimalStr = "";
  let next = 0;
  for (let i = decimalMaxLen - 1; i >= 0; i--) {
    let num = parseInt(arr1[1][i]) + parseInt(arr2[1][i]) + next;
    decimalStr = (num % 10) + decimalStr;
    next = Math.floor(num / 10);
  }
  let IntRes = addBig(arr1[0], arr2[0]);
  if (next == 1) {
    return addBig(IntRes, "1") + "." + decimalStr;
  }
  return IntRes + "." + decimalStr;
};

console.log(addBigEdition("0.723", "123.00"));
